######################
#### BIBLIOTECAS #####
######################

library(dplyr)
library(ggplot2)
library(readxl)
library(xlsx)
library(tidyr)
library(extrafont)

######################
#### CARREGAMENTO ####
######################

Lista_Deputados <- read_excel("~/Dados Camara/Listagem_Deputados_Comparacao.xlsx")
Lista_Deputados_Real <- Lista_Deputados[,c(7,14,15,23,24,25,34,36,39,41,43,45,50,51,57:71)]
Lista_Deputados_Real$Contagem <- 1
Lista_Deputados_Real$Grupo <- ifelse(Lista_Deputados_Real$GRUPO_ANALISE == "Renova/MBL", "i) Renovadores",
                              ifelse(Lista_Deputados_Real$GRUPO_ANALISE == "Outsider", "ii) Outsiders",
                              ifelse(Lista_Deputados_Real$GRUPO_ANALISE == "Estabilishment",
                                     "iii) Estabelecidos","NA")))

Partidos <- read_excel("~/Dados Camara/Ideologia_Codato.xlsx")

Lista_Deputados_Real <- left_join(Lista_Deputados_Real, Partidos, by=c("NR_PARTIDO"="Numero"))
Lista_Deputados_Real <- Lista_Deputados_Real[,c(1:31,33)]

Divisao_Grupos <- Lista_Deputados_Real %>%
  group_by(Grupo) %>%
  summarise(Total = sum(Contagem))

Divisao_Estado <- Lista_Deputados_Real %>%
  group_by(SG_UF) %>%
  summarise(Total = sum(Contagem))

options(scipen = 999)
windowsFonts(Times=windowsFont("Times New Roman"))

######################
####### GENERO #######
######################


Base_Temporaria <- Lista_Deputados_Real %>%
  group_by(Grupo, DS_GENERO) %>%
  summarise(Contagem = sum(Contagem))

Base_Temporaria <- left_join(Base_Temporaria,Divisao_Grupos,
                             by=c("Grupo"="Grupo"))
colnames(Base_Temporaria) <- c("Grupo", "Genero", "Contagem", "Total")

Base_Temporaria$Perc <- (Base_Temporaria$Contagem / Base_Temporaria$Total) * 100

write.xlsx(Base_Temporaria, file = "Bases_Descritivas.xlsx", 
           sheetName = "Genero", append = TRUE)

write.xl

Grafico = ggplot(Base_Temporaria, aes(x = Grupo, y = Perc, fill = Genero, label = round(Perc, 2))) +
  geom_col() +
  geom_text(position = position_stack(vjust = 0.5), size = 9, family = "Times") +
  labs(x="Grupos analisados", 
       y="Percentual de deputados (as) - por g�nero", 
       colour = "G�nero") +
  theme(axis.text.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),
        axis.text.y = element_text(color = "black", size = 20, angle = 0, hjust = 1, vjust = 0, face = "plain", family="Times"),  
        axis.title.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = 0, face = "plain", family="Times"),
        axis.title.y = element_text(color = "black", size = 20, angle = 90, hjust = .5, vjust = .5, face = "plain", family="Times"),
        legend.text = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"),
        legend.title = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"))

Grafico

####################################################################

Temp_Q2 <- Base_Temporaria %>%
  group_by(Grupo, Genero) %>%
  summarise(Perc = sum(Perc))

Temp_Q2 <- spread(Temp_Q2, Genero, Perc)

Temp_Q2 <- Temp_Q2 %>% 
  mutate_all(replace_na, 0)

Temp_Q2 = Temp_Q2[,c(2:ncol(Temp_Q2))]

chisq.test(Temp_Q2)

######################
######## RACA ########
######################


Base_Temporaria <- Lista_Deputados_Real %>%
  group_by(Grupo, DS_COR_RACA) %>%
  summarise(Contagem = sum(Contagem))

Base_Temporaria <- left_join(Base_Temporaria,Divisao_Grupos,
                             by=c("Grupo"="Grupo"))
colnames(Base_Temporaria) <- c("Grupo", "Raca", "Contagem", "Total")

Base_Temporaria$Perc <- (Base_Temporaria$Contagem / Base_Temporaria$Total) * 100


Grafico = ggplot(Base_Temporaria, aes(x = Grupo, y = Perc, fill = Raca, label = round(Perc, 2))) +
  geom_col() +
  geom_text(position = position_stack(vjust = 0.5), size = 9, family = "Times") +
  labs(x="Grupos analisados", 
       y="Percentual de deputados (as) - por ra�a", 
       colour = "Ra�a") +
  theme(axis.text.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),
        axis.text.y = element_text(color = "black", size = 20, angle = 0, hjust = 1, vjust = 0, face = "plain", family="Times"),  
        axis.title.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = 0, face = "plain", family="Times"),
        axis.title.y = element_text(color = "black", size = 20, angle = 90, hjust = .5, vjust = .5, face = "plain", family="Times"),
        legend.text = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"),
        legend.title = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"))
Grafico

####################################################################

Temp_Q2 <- Base_Temporaria %>%
  group_by(Grupo, Raca) %>%
  summarise(Perc = sum(Perc))

Temp_Q2 <- spread(Temp_Q2, Raca, Perc)

Temp_Q2 <- Temp_Q2 %>% 
  mutate_all(replace_na, 0)

Temp_Q2 = Temp_Q2[,c(2:ncol(Temp_Q2))]

chisq.test(Temp_Q2)

######################
##### INSTRUCAO ######
######################

Base_Temporaria <- Lista_Deputados_Real %>%
  group_by(Grupo, DS_GRAU_INSTRUCAO) %>%
  summarise(Contagem = sum(Contagem))

Base_Temporaria <- left_join(Base_Temporaria,Divisao_Grupos,
                             by=c("Grupo"="Grupo"))
colnames(Base_Temporaria) <- c("Grupo", "Escolaridade", "Contagem", "Total")

Base_Temporaria$Perc <- (Base_Temporaria$Contagem / Base_Temporaria$Total) * 100


Grafico = ggplot(Base_Temporaria, aes(x = Grupo, y = Perc, fill = Escolaridade, label = round(Perc, 2))) +
  geom_col() +
  geom_text(position = position_stack(vjust = 0.5), size = 9, family = "Times") +
  labs(x="Grupos analisados", 
       y="Percentual de deputados (as) - por escolaridade", 
       colour = "Escolaridade") +
  theme(axis.text.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),
        axis.text.y = element_text(color = "black", size = 20, angle = 0, hjust = 1, vjust = 0, face = "plain", family="Times"),  
        axis.title.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = 0, face = "plain", family="Times"),
        axis.title.y = element_text(color = "black", size = 20, angle = 90, hjust = .5, vjust = .5, face = "plain", family="Times"),
        legend.text = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"),
        legend.title = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"))
Grafico

####################################################################



######################
##### PROFISSAO ######
######################

Base_Temporaria <- Lista_Deputados_Real %>%
  group_by(Grupo, Profissao) %>%
  summarise(Contagem = sum(Contagem))

Base_Temporaria <- left_join(Base_Temporaria,Divisao_Grupos,
                             by=c("Grupo"="Grupo"))
colnames(Base_Temporaria) <- c("Grupo", "Profissao", "Contagem", "Total")

Base_Temporaria$Perc <- (Base_Temporaria$Contagem / Base_Temporaria$Total) * 100


Grafico = ggplot(Base_Temporaria, aes(x = Grupo, y = Perc, fill = Profissao, label = round(Perc, 2))) +
  geom_col() +
  geom_text(position = position_stack(vjust = 0.5), size = 5, family = "Times") +
  labs(x="Grupos analisados", 
       y="Percentual de deputados (as) - por profiss�o", 
       colour = "Profiss�o") +
  theme(axis.text.x = element_text(color = "black", size = 14, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),
        axis.text.y = element_text(color = "black", size = 14, angle = 0, hjust = 1, vjust = 0, face = "plain", family="Times"),  
        axis.title.x = element_text(color = "black", size = 18, angle = 0, hjust = .5, vjust = 0, face = "plain", family="Times"),
        axis.title.y = element_text(color = "black", size = 15, angle = 90, hjust = .5, vjust = .5, face = "plain", family="Times"),
        legend.text = element_text(color = "black", size = 11, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"),
        legend.title = element_text(color = "black", size = 14, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"))
Grafico

####################################################################

Temp_Q2 <- Base_Temporaria %>%
  group_by(Grupo, Profissao) %>%
  summarise(Perc = sum(Perc))

Temp_Q2 <- spread(Temp_Q2, Profissao, Perc)

Temp_Q2 <- Temp_Q2 %>% 
  mutate_all(replace_na, 0)

Temp_Q2 = Temp_Q2[,c(2:ncol(Temp_Q2))]

chisq.test(Temp_Q2)


######################
##### OCUPACAO ######
######################

Base_Temporaria <- Lista_Deputados_Real %>%
  group_by(Grupo, Ocupacao) %>%
  summarise(Contagem = sum(Contagem))

Base_Temporaria <- left_join(Base_Temporaria,Divisao_Grupos,
                             by=c("Grupo"="Grupo"))
colnames(Base_Temporaria) <- c("Grupo", "Profissao", "Contagem", "Total")

Base_Temporaria$Perc <- (Base_Temporaria$Contagem / Base_Temporaria$Total) * 100


Grafico = ggplot(Base_Temporaria, aes(x = Grupo, y = Perc, fill = Profissao, label = round(Perc, 2))) +
  geom_col() +
  geom_text(position = position_stack(vjust = 0.5), size = 5, family = "Times") +
  labs(x="Grupos analisados", 
       y="Percentual de deputados (as) - por profiss�o", 
       colour = "Profiss�o") +
  theme(axis.text.x = element_text(color = "black", size = 14, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),
        axis.text.y = element_text(color = "black", size = 14, angle = 0, hjust = 1, vjust = 0, face = "plain", family="Times"),  
        axis.title.x = element_text(color = "black", size = 18, angle = 0, hjust = .5, vjust = 0, face = "plain", family="Times"),
        axis.title.y = element_text(color = "black", size = 15, angle = 90, hjust = .5, vjust = .5, face = "plain", family="Times"),
        legend.text = element_text(color = "black", size = 11, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"),
        legend.title = element_text(color = "black", size = 14, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"))
Grafico

####################################################################

Temp_Q2 <- Base_Temporaria %>%
  group_by(Grupo, Profissao) %>%
  summarise(Perc = sum(Perc))

Temp_Q2 <- spread(Temp_Q2, Profissao, Perc)

Temp_Q2 <- Temp_Q2 %>% 
  mutate_all(replace_na, 0)

Temp_Q2 = Temp_Q2[,c(2:ncol(Temp_Q2))]

chisq.test(Temp_Q2)

######################
##### PROFISSAO ######
######################

Base_Temporaria <- Lista_Deputados_Real %>%
  group_by(Grupo, Profissao) %>%
  summarise(Contagem = sum(Contagem))

Base_Temporaria <- left_join(Base_Temporaria,Divisao_Grupos,
                             by=c("Grupo"="Grupo"))
colnames(Base_Temporaria) <- c("Grupo", "Profissao", "Contagem", "Total")

Base_Temporaria$Perc <- (Base_Temporaria$Contagem / Base_Temporaria$Total) * 100


Grafico = ggplot(Base_Temporaria, aes(x = Grupo, y = Perc, fill = Profissao, label = round(Perc, 2))) +
  geom_col() +
  geom_text(position = position_stack(vjust = 0.5), size = 5, family = "Times") +
  labs(x="Grupos analisados", 
       y="Percentual de deputados (as) - por profiss�o", 
       colour = "Profiss�o") +
  theme(axis.text.x = element_text(color = "black", size = 11, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),
        axis.text.y = element_text(color = "black", size = 11, angle = 0, hjust = 1, vjust = 0, face = "plain", family="Times"),  
        axis.title.x = element_text(color = "black", size = 11, angle = 0, hjust = .5, vjust = 0, face = "plain", family="Times"),
        axis.title.y = element_text(color = "black", size = 11, angle = 90, hjust = .5, vjust = .5, face = "plain", family="Times"),
        legend.text = element_text(color = "black", size = 11, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"),
        legend.title = element_text(color = "black", size = 11, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"))
Grafico

####################################################################

Temp_Q2 <- Base_Temporaria %>%
  group_by(Grupo, Profissao) %>%
  summarise(Perc = sum(Perc))

Temp_Q2 <- spread(Temp_Q2, Profissao, Perc)

Temp_Q2 <- Temp_Q2 %>% 
  mutate_all(replace_na, 0)

Temp_Q2 = Temp_Q2[,c(2:ncol(Temp_Q2))]

chisq.test(Temp_Q2)

######################
##### IDEOLOGIA ######
######################

Base_Temporaria <- Lista_Deputados_Real %>%
  group_by(Grupo, Ideologia) %>%
  summarise(Contagem = sum(Contagem))

Base_Temporaria <- left_join(Base_Temporaria,Divisao_Grupos,
                             by=c("Grupo"="Grupo"))
colnames(Base_Temporaria) <- c("Grupo", "Ideologia", "Contagem", "Total")

Base_Temporaria$Perc <- (Base_Temporaria$Contagem / Base_Temporaria$Total) * 100


Grafico = ggplot(Base_Temporaria, aes(x = Grupo, y = Perc, fill = Ideologia, label = round(Perc, 2))) +
  geom_col() +
  geom_text(position = position_stack(vjust = 0.5), size = 9, family = "Times") +
  labs(x="Grupos analisados", 
       y="Percentual de deputados (as) - por ideologia do partido", 
       colour = "Profiss�o") +
  theme(axis.text.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),
        axis.text.y = element_text(color = "black", size = 20, angle = 0, hjust = 1, vjust = 0, face = "plain", family="Times"),  
        axis.title.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = 0, face = "plain", family="Times"),
        axis.title.y = element_text(color = "black", size = 15, angle = 90, hjust = .5, vjust = .5, face = "plain", family="Times"),
        legend.text = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"),
        legend.title = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"))
Grafico

####################################################################

Temp_Q2 <- Base_Temporaria %>%
  group_by(Grupo, Ideologia) %>%
  summarise(Perc = sum(Perc))

Temp_Q2 <- spread(Temp_Q2, Ideologia, Perc)

Temp_Q2 <- Temp_Q2 %>% 
  mutate_all(replace_na, 0)

Temp_Q2 = Temp_Q2[,c(2:ncol(Temp_Q2))]

chisq.test(Temp_Q2)


######################
######## IDADE #######
######################

Grafico = ggplot(Lista_Deputados_Real, aes(x = Grupo, y= NR_IDADE_DATA_POSSE, color = Grupo)) +
  geom_boxplot() +
  scale_y_continuous(limits=c(0,100), breaks=seq(0,100,10), expand = c(0, 0)) + 
  labs(x="Grupos analisados", 
       y="Idade (em anos)", 
       colour = "Grupos analisados") +
  theme(axis.text.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),
        axis.text.y = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),  
        axis.title.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = 0, face = "plain", family="Times"),
        axis.title.y = element_text(color = "black", size = 20, angle = 90, hjust = .5, vjust = .5, face = "plain", family="Times"),
        legend.text = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"),
        legend.title = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"))
Grafico + theme_bw()

Temp_Var <- Lista_Deputados_Real %>%
  group_by(Grupo) %>%
  summarise(Total = mean(NR_IDADE_DATA_POSSE))

##############################################################

Modelo_Anova <- aov(NR_IDADE_DATA_POSSE ~ Grupo, data = Lista_Deputados_Real)
summary(Modelo_Anova)
Modelo_Anova$coefficients

############################
######### TESTE - T ########
############################

Comp_G1  <- subset(Lista_Deputados_Real, Lista_Deputados_Real$Grupo == "i) Renovadores")
Comp_G2  <- subset(Lista_Deputados_Real, Lista_Deputados_Real$Grupo == "ii) Outsiders")
Comp_G3  <- subset(Lista_Deputados_Real, Lista_Deputados_Real$Grupo == "iii) Estabelecidos")

t.test(Comp_G1$NR_IDADE_DATA_POSSE, Comp_G2$NR_IDADE_DATA_POSSE, paired = FALSE)
t.test(Comp_G1$NR_IDADE_DATA_POSSE, Comp_G3$NR_IDADE_DATA_POSSE, paired = FALSE)
t.test(Comp_G2$NR_IDADE_DATA_POSSE, Comp_G3$NR_IDADE_DATA_POSSE, paired = FALSE)


#######################
# FINANCIAMENTO PRIVADO
#######################

Grafico = ggplot(Lista_Deputados_Real, aes(x = Grupo, y= FINANCIAMENTO_PRIVADO, color = Grupo)) +
  geom_boxplot() +
  #  scale_y_continuous(limits=c(0,3000000), breaks=seq(0,500000), expand = c(0, 0)) + 
  labs(x="Grupos analisados", 
       y="Financiamento privado (em R$)", 
       colour = "Grupos analisados") +
  theme(axis.text.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),
        axis.text.y = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),  
        axis.title.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = 0, face = "plain", family="Times"),
        axis.title.y = element_text(color = "black", size = 20, angle = 90, hjust = .5, vjust = .5, face = "plain", family="Times"),
        legend.text = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"),
        legend.title = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"))
Grafico

Temp_Var <- Lista_Deputados_Real %>%
  group_by(Grupo) %>%
  summarise(Total = mean(FINANCIAMENTO_PRIVADO), Mediana = median(FINANCIAMENTO_PRIVADO))

##############################################################

Modelo_Anova <- aov(FINANCIAMENTO_PRIVADO ~ Grupo, data = Lista_Deputados_Real)
summary(Modelo_Anova)
Modelo_Anova$coefficients

############################
######### TESTE - T ########
############################

t.test(Comp_G1$FINANCIAMENTO_PRIVADO, Comp_G2$FINANCIAMENTO_PRIVADO, paired = FALSE)
t.test(Comp_G1$FINANCIAMENTO_PRIVADO, Comp_G3$FINANCIAMENTO_PRIVADO, paired = FALSE)
t.test(Comp_G2$FINANCIAMENTO_PRIVADO, Comp_G3$FINANCIAMENTO_PRIVADO, paired = FALSE)

#######################
# FINANCIAMENTO PUBLICO
#######################

Grafico = ggplot(Lista_Deputados_Real, aes(x = Grupo, y= FINANCIAMENTO_PUBLICO, color = Grupo)) +
  geom_boxplot() +
  #  scale_y_continuous(limits=c(0,3000000), breaks=seq(0,500000), expand = c(0, 0)) + 
  labs(x="Grupos analisados", 
       y="Financiamento p�blico (em R$)", 
       colour = "Grupos analisados") +
  theme(axis.text.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),
        axis.text.y = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),  
        axis.title.x = element_text(color = "black", size = 20, angle = 0, hjust = .5, vjust = 0, face = "plain", family="Times"),
        axis.title.y = element_text(color = "black", size = 20, angle = 90, hjust = .5, vjust = .5, face = "plain", family="Times"),
        legend.text = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"),
        legend.title = element_text(color = "black", size = 20, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"))
Grafico

Temp_Var <- Lista_Deputados_Real %>%
  group_by(Grupo) %>%
  summarise(Total = mean(FINANCIAMENTO_PUBLICO), Mediana = median(FINANCIAMENTO_PUBLICO))

##############################################################

Modelo_Anova <- aov(FINANCIAMENTO_PUBLICO ~ Grupo, data = Lista_Deputados_Real)
summary(Modelo_Anova)
Modelo_Anova$coefficients

############################
######### TESTE - T ########
############################

t.test(Comp_G1$FINANCIAMENTO_PUBLICO, Comp_G2$FINANCIAMENTO_PUBLICO, paired = FALSE)
t.test(Comp_G1$FINANCIAMENTO_PUBLICO, Comp_G3$FINANCIAMENTO_PUBLICO, paired = FALSE)
t.test(Comp_G2$FINANCIAMENTO_PUBLICO, Comp_G3$FINANCIAMENTO_PUBLICO, paired = FALSE)


#######################
# FINANCIAMENTO TOTAL
#######################

Grafico = ggplot(Lista_Deputados_Real, aes(x = Grupo, y= FINANCIAMENTO_TOTAL, color = Grupo)) +
  geom_boxplot() +
  #  scale_y_continuous(limits=c(0,3000000), breaks=seq(0,500000), expand = c(0, 0)) + 
  labs(x="Grupos analisados", 
       y="Financiamento Total (em R$)", 
       colour = "Grupos analisados") +
  theme(axis.text.x = element_text(color = "black", size = 14, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),
        axis.text.y = element_text(color = "black", size = 14, angle = 0, hjust = .5, vjust = .5, face = "plain", family="Times"),  
        axis.title.x = element_text(color = "black", size = 18, angle = 0, hjust = .5, vjust = 0, face = "plain", family="Times"),
        axis.title.y = element_text(color = "black", size = 15, angle = 90, hjust = .5, vjust = .5, face = "plain", family="Times"),
        legend.text = element_text(color = "black", size = 11, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"),
        legend.title = element_text(color = "black", size = 14, angle = 0, hjust = 0, vjust = .5, face = "plain", family="Times"))
Grafico

Temp_Var <- Lista_Deputados_Real %>%
  group_by(Grupo) %>%
  summarise(Total = mean(FINANCIAMENTO_TOTAL), Mediana = median(FINANCIAMENTO_TOTAL))

##############################################################
